import React from "react"
// 导入movie_item样式
import styles from "../css/movie_item.scss"
// 导入电影评分组件
import { Rate } from 'antd';
export default class MovieItem extends React.Component{
    constructor(props){
        super(props)
        this.state={

        }
    }
    render(){
        return <div className={styles.box} onClick={this.jumpMovieDetail}>
            <img className={styles.img} src={this.props.images.small} alt=""/>
            {/* replace('img3.doubanio.com','img1.doubanio.com') */}
            <h5>电影名称:{this.props.title}</h5>
            <h5>上映年份:{this.props.year}年</h5>
            <h5>电影类型:{this.props.genres.join('/')}</h5>
            <Rate disabled defaultValue={this.props.rating.average/2} />
        </div>
    }
    jumpMovieDetail=()=>{
        this.props.history.push(`/movie/detail/${this.props.id}`)
    }
}